#include "introduct.h"
#include "ui_introduct.h"

#include <QFile>
#include <QMessageBox>

introduct::introduct(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::introduct)
{
    this->setWindowFlags(Qt::WindowCloseButtonHint);
    ui->setupUi(this);
    //设置无边框
    connect(ui->btn_isFinish,&QPushButton::clicked,this,&introduct::sendSlot);

    //加载样式表
    QString styleSheetFile = ":/new/prefix2/StyleSheet/introductStyle.qss";
    QFile file(styleSheetFile);
    file.open(QFile::ReadOnly);
    if (file.isOpen())
    {
        QString styleSheet = this->styleSheet();
        styleSheet += QLatin1String(file.readAll());//读取样式表文件
        this->setStyleSheet(styleSheet);
        file.close();
    }
//    else
//    {
//        QMessageBox::information(this,"tip","cannot find qss file");
//    }

}

introduct::~introduct()
{
    delete ui;
}

void introduct::sendSlot()
{
    emit signClicked();
}

void introduct::setText(QString temp)
{
    ui->label_intro->setText(temp);
}

void introduct::setTitle(QString s)
{
    ui->label->setText(s + "详细介绍");
}

void introduct::setOrderText(QString order)
{
    this->order = order;
}

void introduct::on_btn_isFinish_clicked()
{
    QSqlQuery query;
    query.exec(order);
}

void introduct::on_pushButton_clicked()
{
    this->close();
}
